package com.youan.serve.service.impl;

import com.youan.serve.dao.domain.RoleFunction;
import com.youan.serve.dao.idao.RoleFunctionMapper;
import com.youan.serve.service.IRoleFunctionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author auto_code
 * @since 2020-03-04
 */
@Service
public class RoleFunctionServiceImpl extends ServiceImpl<RoleFunctionMapper, RoleFunction> implements IRoleFunctionService {

    @Override
    public List<String> getSelectedFunctions(String roleId) throws Exception {
        List<RoleFunction> roleFunctionList = this.list();
        List<String> list = new ArrayList<String>();
        for(RoleFunction roleFunction : roleFunctionList){
            if(roleFunction.getRoleId().equals(roleId)){
                String RFid = roleFunction.getFunctionId();
                list.add(RFid);
            }
        }
        return list;
    }
}
